package headfirst.designpatterns.factory.a_cars_simplefactory2.boss;

import headfirst.designpatterns.factory.a_cars_simplefactory2.car.Car;
import headfirst.designpatterns.factory.a_cars_simplefactory2.factory.DriverSimplyFactory;

/**
 * @description: TODO
 * @author: 陈家盛
 * @date: 2022/6/22 11:46
 * @version: 1.0
 */
public class BossCall {
    DriverSimplyFactory factory;

    public BossCall(DriverSimplyFactory factory) {
        this.factory = factory;
    }

    /**
     * 使用简单工工厂创建具体车
     * @param type
     * @return
     */
    public Car callCar(String type) {
        Car car;
        car = factory.createCar(type);
        return car;
    }
}
